<html>
<head>
<style type='text/css'>
body {
   background-color: white;
   margin: 1em 2em 1em 2em;
   font-family: Sans-Serif;
   color: #002;
   line-height: 140%;
   font-size: 12px;
}

h1 {
    font-size: 140%;
}

h2 {
    font-size: 130%;
}

h3 {
    font-size: 120%;
}

h4 {
    font-size: 100%;
    font-style: normal;
    font-weight: bold;
}

h5 {
    font-size: 100%;
    font-style: italic;
    font-weight: normal;
}

pre {
   background-color: #eee;
   padding: 0.5em 0.5em 0.5em 2em;
}

@media print {
   pre {word-wrap:break-word; width:100%;}
} 

ul li,
ol li {
   padding-left: 0.3em;
   /*text-indent: -2em;*/
   margin-bottom: 0.5em;
}

em {
   font-style: normal;
   font-weight: bold;
   text-decoration: underline;
   color: #c40;
}

code {
   font-family: Monospace;
   font-size: 100%;
   color: #c40;
}

a, a * {
   text-decoration: underline;
   color: #14a0d1;
   /* border: 0.5px solid #aaa;
   white-space: nowrap;
   padding-right: 0.1em;
   padding-left: 0.1em;
   padding-bottom: -5px; */
}

a code {
   color: #14a0d1;
}

img {
   position: relative;
   bottom: -4px;
}

div.headline {
   font-weight: bold;
   font-size: 110%;
}

div.copyright {
   margin-top: 1em;
   border-top: 1px solid black;
   padding-top: 0.5em;
}

div.iris_headline {
   border-bottom: 1px solid black;
   padding-bottom: 0.3em;
}

.LaTeX {
   font-family: Monospace;
   font-size: 100%;
   border: 1px solid #060;
   color: #060;
}

code.LaTeX {
   background-color: white;
   padding: 0.5em 0.5em 0.5em 2em;
}
</style>
</head>

<body>
<div class="iris_headline">IRIS Toolbox Reference Manual</div>




<h2 id="tseries/plotpred">plotpred</h2>
<div class="headline">Visualize multi-step-ahead predictions</div>

<h4 id="syntax">Syntax</h4>
<pre><code>[H1,H2,H3] = plotpred(X,Y,...)
[H1,H2,H3] = plotpred(Ax,X,Y,...)
[H1,H2,H3] = plotpred(Ax,Range,X,Y,...)</code></pre>
<h4 id="input-arguments">Input arguments</h4>
<ul>
<li><p><code>X</code> [ tseries ] - Input data with time series observations.</p></li>
<li><p><code>Y</code> [ tseries ] - Prediction data arranged as described below; the prediction data returned from a Kalman filter can be used, see Example below.</p></li>
<li><p><code>Ax</code> [ numeric ] - Handle to axes object in which the data will be plotted.</p></li>
<li><p><code>Range</code> [ numeric | Inf ] - Date range on which the input data will be plotted.</p></li>
</ul>
<h4 id="output-arguments">Output arguments</h4>
<ul>
<li><p><code>H1</code> [ numeric ] - Handles to a line object showing the time series observations (the first column, <code>X</code>, in the input data).</p></li>
<li><p><code>H2</code> [ numeric ] - Handles to line objects showing the Kalman filter predictions (the second and further columns, <code>Y</code>, in the input data).</p></li>
<li><p><code>H3</code> [ numeric ] - Handles to one-point line objects displaying a marker at the start of each line.</p></li>
</ul>
<h4 id="options">Options</h4>
<ul>
<li><p><code>'connect='</code> [ <em><code>true</code></em> | <code>false</code> ] - Connect the prediction lines, <code>Y</code>, with the corresponding observation in <code>X</code>.</p></li>
<li><p><code>'firstMarker='</code> [ <em><code>'none'</code></em> | char ] - Type of marker displayed at the start of each prediction line.</p></li>
<li><p><code>'showNaNLines='</code> [ <em><code>true</code></em> | <code>false</code> ] - Show or remove lines with whose starting points are NaN (missing observations).</p></li>
</ul>
<p>See help on <a href="../tseries/plot.html"><code>plot</code></a> and on the built-in function <code>plot</code> for options available.</p>
<h4 id="description">Description</h4>
<p>The input data <code>Y</code> need to be a multicolumn time series (tseries object), with one-step-ahead predictions <code>x(t|t-1)</code> in the first column, two-step-ahead predictions <code>x(t|t-2)</code> in the second column, and so on. Note the timing assumptions.</p>
<p>If <code>x1</code> is a series with one-step-ahead predictions <code>x(t+1|t)</code>, <code>x2</code> is a series with two-step-ahead predictions <code>x(t+2|t)</code>, and so on, while <code>x</code> is a series with the actual observations <code>x(t)</code>, the following command will create a time series that can be then passed into <code>plotpred( )</code>:</p>
<pre><code>p = [ x1{-1}, x2{-2}, ..., xn{-n} ];
plotpred(x, p);</code></pre>
<h4 id="example">Example</h4>
<p>The <code>plotpred( )</code> function can be used with prediction-step data returned from a Kalman filter, <a href="../model/filter.html"><code>filter</code></a>. The prediction-step data need to be specifically requested using the <code>'output='</code> option (as they are not included in the output database by default), with the prediction horizon assigned in the <code>'ahead='</code> option (the horizon is <code>1</code> by default):</p>
<pre><code>[~, g] = filter(m, d, startDate:endDate, ...
    &#39;output=&#39;, &#39;pred&#39;, &#39;meanOnly=&#39;, true, &#39;ahead=&#39;, 8); 

figure( );
plotpred(startdate:enddate, d.x, g.pred.x); </code></pre>

</body>
<div class="copyright">IRIS Toolbox. Copyright &copy; 2007-2015 IRIS Solutions Team.</div>
</html>
